import React from 'react'
import style from './index.less'
import { PhoneFill } from 'antd-mobile-icons';
import { Modal, Button ,Dialog, Toast} from 'antd-mobile';
import { history } from 'umi';
export default function index() {
    const [visible2, setVisible2] = React.useState<boolean>(false);
   
   
  return (
    <div className={style.btns}>
    
        <Button 
            className={style.btn}
            size="small"
            onClick={async () => {

                setVisible2(true);
  
              }}
        >
            联系商家
        </Button>
        <Button 
            className={style.btn}
            size="small"
            onClick={() =>
              Dialog.confirm({
                content: '是否放弃交易',
                onConfirm: async () => {
                  
                  Toast.show({
                    icon: 'success',
                    content: '提交成功',
                    position: 'bottom',
                  })
                },
              })
            }
          >
           放弃交易
        </Button>
        <Button 
            className={style.btn}
            color='success'
            fill='outline'
            size="small"
            onClick={() => {
              history.push('confirm2');
          }}

        >
            确认交易
        </Button>
        
        <Modal
        visible={visible2}
        transparent
        maskClosable={false}
        showCloseButton={true}
        onClose={() => {
          setVisible2(false);
        }}
        title="联系方式"
        className={style.modal2}
        content={
          (<div className={style['info-warp']}>
            <div className={style.line2}>
              <div className={style.info}>
                <div className={style.tip}>
                  以下是采购方的联系方式，请电话联系
                </div>
                <div className={style.phone}>
                  <span>
                    {'杨世杰'}
                    {'1006565656'}
                  </span>
                </div>
              </div>
              <div
                className={style.icon}
                onClick={() => {

                }}
              >
                <div>
                  <PhoneFill />
                </div>
                呼叫
              </div>
            </div>
          </div>)}
      >


      </Modal>



    </div>
  )
}
